package com.zhuss.timer;

import java.time.LocalDateTime;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.order.order.OverOrderTimeBo;
import com.zhuss.exception.DzcxException;
import com.zhuss.order.processor.OrderOverTime;

@Component
@Configuration      
@EnableScheduling
public class OverTimeUnPayOrderScheduleTask {
	
	@Autowired
	private OrderOverTime orderOverTime;
	
	
    @Scheduled(cron = "0 */15 * * * ?")
    private void configureTasks() throws DzcxException {
    	System.out.println(System.currentTimeMillis());
    	orderOverTime.process(new OverOrderTimeBo());
    	System.out.println(System.currentTimeMillis());
        System.err.println("自动过期未支付订单: " + LocalDateTime.now());
    }
    
}
